﻿using System;
using System.IO;
using FunctionalCLR.Core;

namespace FunctionalCLR.Shell.Function.IO {

    /// <summary>
    /// hasfile("c:\\hello.txt");
    /// </summary>
    public class CreateFileNode : FuncNode {

        public CreateFileNode()
            : base() {
            base.Value = "create";
        }

        public override object Evaluate() {
            string fileName = Children[0].Evaluate().ToString();
            File.Create(fileName);

            return fileName;
        }
    }
}
